<template>
  <div class="dashboard">
    <el-container>
      <el-aside width="200px">
        <el-menu
          default-active="1"
          class="el-menu-vertical"
          :router="true"
        >
          <el-menu-item index="1">
            <el-icon><HomeFilled /></el-icon>
            <span>首页</span>
          </el-menu-item>
          <el-sub-menu index="2">
            <template #title>
              <el-icon><User /></el-icon>
              <span>门诊管理</span>
            </template>
            <el-menu-item index="2-1">挂号管理</el-menu-item>
            <el-menu-item index="2-2">就诊管理</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="3">
            <template #title>
              <el-icon><Files /></el-icon>
              <span>住院管理</span>
            </template>
            <el-menu-item index="3-1">入院管理</el-menu-item>
            <el-menu-item index="3-2">病房管理</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="4">
            <template #title>
              <el-icon><Medicine /></el-icon>
              <span>药房管理</span>
            </template>
            <el-menu-item index="4-1">药品管理</el-menu-item>
            <el-menu-item index="4-2">处方管理</el-menu-item>
          </el-sub-menu>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header style="text-align: right; font-size: 12px">
          <el-dropdown>
            <span class="el-dropdown-link">
              管理员
              <el-icon class="el-icon--right">
                <arrow-down />
              </el-icon>
            </span>
            <template #dropdown>
              <el-dropdown-menu>
                <el-dropdown-item>个人信息</el-dropdown-item>
                <el-dropdown-item>修改密码</el-dropdown-item>
                <el-dropdown-item divided>退出登录</el-dropdown-item>
              </el-dropdown-menu>
            </template>
          </el-dropdown>
        </el-header>
        <el-main>
          <el-row :gutter="20">
            <el-col :span="8">
              <el-card class="box-card">
                <template #header>
                  <div class="card-header">
                    <span>今日门诊</span>
                  </div>
                </template>
                <div class="item">
                  <span>待诊人数：25</span>
                </div>
                <div class="item">
                  <span>已诊人数：38</span>
                </div>
              </el-card>
            </el-col>
            <el-col :span="8">
              <el-card class="box-card">
                <template #header>
                  <div class="card-header">
                    <span>住院信息</span>
                  </div>
                </template>
                <div class="item">
                  <span>在院人数：120</span>
                </div>
                <div class="item">
                  <span>空床数量：45</span>
                </div>
              </el-card>
            </el-col>
            <el-col :span="8">
              <el-card class="box-card">
                <template #header>
                  <div class="card-header">
                    <span>药房信息</span>
                  </div>
                </template>
                <div class="item">
                  <span>待取药处方：15</span>
                </div>
                <div class="item">
                  <span>库存预警：3</span>
                </div>
              </el-card>
            </el-col>
          </el-row>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import {
  HomeFilled,
  User,
  Files,
  Medicine,
  ArrowDown
} from '@element-plus/icons-vue'
</script>

<style scoped>
.dashboard {
  height: 100vh;
}

.el-header {
  background-color: #fff;
  color: #333;
  line-height: 60px;
  border-bottom: 1px solid #dcdfe6;
}

.el-aside {
  background-color: #304156;
  color: #333;
}

.el-menu {
  border-right: none;
}

.el-menu-vertical {
  height: 100%;
  background-color: #304156;
}

.el-menu-item, .el-sub-menu__title {
  color: #bfcbd9;
}

.el-menu-item:hover, .el-sub-menu__title:hover {
  color: #fff !important;
}

.el-menu-item.is-active {
  color: #409EFF !important;
}

.box-card {
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item {
  margin-bottom: 18px;
  font-size: 16px;
}

.el-dropdown-link {
  cursor: pointer;
  display: flex;
  align-items: center;
  color: #409EFF;
}

.el-dropdown-link:hover {
  color: #66b1ff;
}
</style> 